﻿Imports System.Data.OleDb
Public Class TaiKhoanDAO
    Public Function GetTK(ByVal tmp As TaiKhoanDTO) As Integer
        Dim cn As OleDbConnection = DataProvider.ConnectionData()
        Dim str As String = "select ID, Pass, MaLoai from NhanVien nv, TaiKhoan tk, KhachHang kh where nv.MaNhanVien = tk.MaNhanVien and kh.MaKhachHang=tk.MaKhachHang"
        Dim cmd As OleDbCommand = New OleDbCommand(str, cn)
        Dim para1, para2, para3 As OleDbParameter
        para1 = New OleDbParameter("ID", tmp.ID)
        cmd.Parameters.Add(para1)
        para2 = New OleDbParameter("Pass", tmp.Pass)
        cmd.Parameters.Add(para2)
        para3 = New OleDbParameter("MaLoai", tmp.Loai)
        cmd.Parameters.Add(para3)
        Dim result As Integer = cmd.ExecuteNonQuery()
        cn.Close()
        Return result
    End Function
End Class
